<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>数据字典</title>
<script type="text/javascript">

//初始化checkbox
jQuery("document").ready(function(){
	jQuery("#all").click(function(){
			var flag = document.getElementById("all").checked;
	   	 	jQuery("[name=selId]:checkbox").each(function() {
	        		jQuery(this).attr("checked", flag);
	   		});
	 });
	   	 	
	   	 $("#Pagination").paginate({
	   		count 		: '${count}',	//页数
	   		start 		: '${currentPageNo}',
	   		display     : 10,
	   		border					: true,
	   		border_color			: '#BEF8B8',
	   		text_color  			: '#68BA64',
	   		background_color    	: '#CAE8EA',	
	   		border_hover_color		: '#68BA64',
	   		text_hover_color  		: 'black',
	   		background_hover_color	: '#CAE8EA', 
	   		rotate      : false,
	   		images		: false,
	   		mouse		: 'press',
	   		onChange     			: function(page){								
	   		 var id = '${dictId}';
				$.ajax( {
	    			type : 'GET',
	    			url :"${pageContext.request.contextPath}/ufmDict/ajaxGetTree?parentId="+id+"&currentPageNo="+page+"&currentPageNo="+"${currentPageNo}",
	    			cache : false,
	    			async:false,
	    			error : function(XMLHttpRequest, textStatus, errorThrown) {
	    				//alert(XMLHttpRequest.readyState);
	    			},
	    			success : function(data) {
	    				$("#resultList").empty();
	    				$("#resultList").html(data);
	    			}
	    		}); 
	   								  }
	   	});
	   	 	
	   	if($.inArray("数据字典_删除", allRights)>=0){
		 	   $("#delete").show();
		 	   $("a[name='delete1']").show();
		 }
		 if($.inArray("数据字典_新增", allRights)>=0){
		 	   $("#add").show();
		 }
		 if($.inArray("数据字典_修改", allRights)>=0){
		 	   $("a[name='edit']").show();
		 }
		 if($.inArray("数据字典_查询", allRights)>=0){
		 	   $("#search").show();
		 }	
	   	 	
	   	 	
	   	 	

});



</script>
</head>
<body>
<table id="mytable" cellspacing="0" summary="The technical specifications of the Apple PowerMac G5 series">  
  <tr>
  	<th><input type="checkbox" id="all" name="all"/></th> 
    <th>序号</th> 
    <th>编号</th> 
    <th>名称</th>
    <th>简码</th>   
    <th>属性1</th>        
    <th>属性2</th>
    <th>顺序号</th>
    <th>停用</th>  
    <th>创建人</th>
    <th>创建时间</th>
    <th>操作</th> 
  </tr> 
  <c:forEach items="${dict}" var="d" varStatus="i">
  	<tr> 
  		<td align="center" ><input type="checkbox" id="selId" name="selId" value="${d.z1}"/></td> 
	   	<td>${i.index+1}</td>
	   	<td>${d.z1}</td>
	   	<td>${d.z3}</td>
	    <td>${d.p11}</td> 
	    <td>${d.z6}</td>	    
	    <td>${d.z7}</td> 
	    <td>${d.p12}</td>	
	    <td>${d.z13==1?"是":"否"}</td>		    
	    <td>${d.p13}</td>
	    <td><fmt:formatDate value="${d.p14}" type="date" pattern="yyyy-MM-dd HH:mm:ss"/></td>	
	    <td><a name="delete1" style="display: none" href="javascript:void(0)" onclick = "deleteById('${d.z1}')">删除</a>
	    	<a name="edit" style="display: none" href="javascript:void(0)" onclick="toUpdatePage('${d.z1}')">修改</a></td>
  	</tr> 
  </c:forEach>  
</table>
<div id="Pagination" ></div>
</body>
</html>
